package org.valire.usermanagement;

import java.util.List;

public interface UserManagementFacade {
	/**
	 * Gets the User entity bean.
	 * 
	 * @param UserName
	 *            the User name
	 * @return the User
	 */
	public UserDto getUser(String userName);

	/**
	 * Creates a new User.
	 * 
	 * @param newUser
	 *            the new User
	 */
	public void createUser(UserDto newUser);

	/**
	 * Removes the User.
	 * 
	 * @param User
	 *            the User
	 */
	public void removeUser(UserDto user);

	/**
	 * 
	 * @param userName
	 */
	public void removeUser(String userName);

	/**
	 * Gets the all Users.
	 * 
	 * @return the all Users
	 */
	public List<UserDto> getAllUsers();

	/**
	 * Gets the User.
	 * 
	 * @param id
	 *            the id
	 * @return the User
	 */
	UserDto getUser(Integer id);

	/**
	 * Update User.
	 * 
	 * @param User
	 *            the User
	 */
	public void updateUser(UserDto User);

	/**
	 * Reset password.
	 * 
	 * @param User
	 *            the User
	 * @return the new password (unencrypted)
	 */
	public String resetPassword(UserDto User);
	
	/**
	 * Adds a permission for the given user on the given category.
	 * 
	 * @param userId
	 * @param categoryId
	 */
	void permit(Integer userId, Integer categoryId);

	/**
	 * 
	 * @param roleName
	 * @return
	 */
	RoleDto getRole(String roleName);
}
